Value of $_POST['submit']

I am working on the following web page tonight:
http://www.actsministrieschristianevangelism.org/verseofthed ay/

I am trying to program the "Load Previous Issue" "Random Issue" and
"Load Next Issue" buttons.

I am using Ajax to pass the date the user is requesting to the PHP
script for processing.

I am wondering how my PHP script may access the value of value of
$_POST['submit']. At present echo $_POST['submit']; doesn't give me a
value. Consequently all queries to the mySQL database fail.

Ron


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Ron Piggott [ Fr, 28 November 2008 02:02 ] [ ID #1979014 ]

Re: Value of $_POST['submit']

Hi Ron,

What's your Javascript client-side code to invoke the PHP-script? You may
need to switch to $_GET[] instead of $_POST...

Yves

----- Original Message -----
From: "Ron Piggott" <ron.php [at] actsministries.org>
To: "PHP DB" <php-db [at] lists.php.net>
Sent: Thursday, November 27, 2008 7:02 PM
Subject: [PHP-DB] Value of $_POST['submit']


>I am working on the following web page tonight:
> http://www.actsministrieschristianevangelism.org/verseofthed ay/
>
> I am trying to program the "Load Previous Issue" "Random Issue" and
> "Load Next Issue" buttons.
>
> I am using Ajax to pass the date the user is requesting to the PHP
> script for processing.
>
> I am wondering how my PHP script may access the value of value of
> $_POST['submit']. At present echo $_POST['submit']; doesn't give me a
> value. Consequently all queries to the mySQL database fail.
>
> Ron
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Yves Sucaet [ Fr, 28 November 2008 02:47 ] [ ID #1979015 ]

RE: Value of $_POST['submit']

When I'm developing a number of pages and don't keep track of every
variable or form name (etc), I plant a print_r($_POST); at the top of
the page, so there's no guessing what gets sent to the page . . .

If you have an empty $_POST array, then the <form> isn't using
action=3Dpost, or you didn't code your button as type=3D"submit" (?)

Just suggestions - since I can't see the code.

Steve

----- Original Message -----
From: "Ron Piggott" <ron.php [at] actsministries.org>
To: "PHP DB" <php-db [at] lists.php.net>
Sent: Thursday, November 27, 2008 7:02 PM
Subject: [PHP-DB] Value of $_POST['submit']


>I am working on the following web page tonight:
> http://www.actsministrieschristianevangelism.org/verseofthed ay/
>
> I am trying to program the "Load Previous Issue" "Random Issue" and
> "Load Next Issue" buttons.
>
> I am using Ajax to pass the date the user is requesting to the PHP
> script for processing.
>
> I am wondering how my PHP script may access the value of value of
> $_POST['submit']. At present echo $_POST['submit']; doesn't give me a
> value. Consequently all queries to the mySQL database fail.
>
> Ron
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Steve.Martin [ Fr, 28 November 2008 03:43 ] [ ID #1979016 ]

RE: Value of $_POST['submit']

Hi Steve, =


He's using Ajax, so some variant of the XMLHttpRequest Javascript object =
on
the client. It may not be obvious which method is used when the data is s=
ent.

Now that I think of it, printing $_SERVER[REQUEST_METHOD] should let you =
know
which one is being used.

hth.

Yves

------ Original Message ------
Received: Thu, 27 Nov 2008 08:48:08 PM CST
From: "Martin, Steve \(MAN-Corporate\)" <Steve.Martin [at] manheim.com>
To: "Yves Sucaet" <yves.sucaet [at] usa.net>, <php-db [at] lists.php.net>
Subject: RE: [PHP-DB] Value of $_POST['submit']

When I'm developing a number of pages and don't keep track of every
variable or form name (etc), I plant a print_r($_POST); at the top of
the page, so there's no guessing what gets sent to the page . . . =


If you have an empty $_POST array, then the <form> isn't using
action=3Dpost, or you didn't code your button as type=3D"submit" (?)

Just suggestions - since I can't see the code.

Steve

----- Original Message ----- =

From: "Ron Piggott" <ron.php [at] actsministries.org>
To: "PHP DB" <php-db [at] lists.php.net>
Sent: Thursday, November 27, 2008 7:02 PM
Subject: [PHP-DB] Value of $_POST['submit']


>I am working on the following web page tonight:
> http://www.actsministrieschristianevangelism.org/verseofthed ay/
>
> I am trying to program the "Load Previous Issue" "Random Issue" and
> "Load Next Issue" buttons.
>
> I am using Ajax to pass the date the user is requesting to the PHP
> script for processing.
>
> I am wondering how my PHP script may access the value of value of
> $_POST['submit']. At present echo $_POST['submit']; doesn't give me a
> value. Consequently all queries to the mySQL database fail.
>
> Ron
>
>
> -- =

> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
> =




-- =

PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


-- =

PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php






--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Yves Sucaet [ Fr, 28 November 2008 05:55 ] [ ID #1979017 ]

Re: Value of $_POST['submit']

On Thu, Nov 27, 2008 at 5:02 PM, Ron Piggott <ron.php [at] actsministries.org> wrote:
> I am wondering how my PHP script may access the value of value of
> $_POST['submit']. At present echo $_POST['submit']; doesn't give me a
> value. Consequently all queries to the mySQL database fail.

Ron, is your AJAX request a POST? Is it actually assigning a value to
"submit"? It sounds like that datum is missing because it's not being
sent.

Steve is incorrect in suggesting that $_POST['submit'] will be
populated with data from an HTML input of type "submit". To achieve
the effect he is describing, you would need to add name="submit" to
that input. None of the keys of $_POST are magically populated. If
your request doesn't submit a variable named "submit", there will be
no such key in the array.

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Fergus Gibson [ Fr, 28 November 2008 23:58 ] [ ID #1979024 ]
PHP » gmane.comp.php.database » Value of $_POST['submit']

Vorheriges Thema: re:database tables relations advice
Nächstes Thema: MS SQL and client encoding